﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MaxLeaf.Common;
using MaxLeaf.DB;

namespace MaxLeaf.DAL
{
    public class mLogDALFactory
    {
        public static bool Delete(DBAccess dbCon, System.Data.DataRowView drv)
        {
            if (dbCon.ServerType == ServerType.K3)
            {
                return new K3.mLogDAL().Delete(dbCon, drv);
            }
            else
            {
                return new Web.mLogDAL().Delete(dbCon, drv);
            }
        }

        public static string GetLogInfo(InFoType infoType, System.Data.DataRowView drv)
        {
            string strMsg = string.Empty;
            switch (infoType)
            {
                case InFoType.CheckLog:
                    strMsg = string.Format("Checked log:{0}_{1}_{2}_{3}", drv[DEL.LogDEL.LogType], drv[DEL.LogDEL.KeyValue], drv[DEL.LogDEL.LogStatus], drv[DEL.LogDEL.UpdateMode]);
                    break;
                case InFoType.DeleteLog:
                    strMsg = string.Format("Deleted log:{0}_{1}_{2}_{3}", drv[DEL.LogDEL.LogType], drv[DEL.LogDEL.KeyValue], drv[DEL.LogDEL.LogStatus], drv[DEL.LogDEL.UpdateMode]);
                    break;
            }

            return strMsg;
        }
    }
}